import request from '@/utils/request'

// 创建设备与保养项关联
export function createMaintenanceDeviceEntry(data) {
  return request({
    url: '/device/maintenance-device-entry/create',
    method: 'post',
    data: data
  })
}

// 批量创建设备与保养项关联
export function createBatchMaintenanceDeviceEntry(data) {
  return request({
    url: '/device/maintenance-device-entry/createBatch',
    method: 'post',
    data: data
  })
}

// 更新设备与保养项关联
export function updateMaintenanceDeviceEntry(data) {
  return request({
    url: '/device/maintenance-device-entry/update',
    method: 'put',
    data: data
  })
}

// 删除设备与保养项关联
export function deleteMaintenanceDeviceEntry(id) {
  return request({
    url: '/device/maintenance-device-entry/delete?id=' + id,
    method: 'delete'
  })
}

// 获得设备与保养项关联
export function getMaintenanceDeviceEntry(id) {
  return request({
    url: '/device/maintenance-device-entry/get?id=' + id,
    method: 'get'
  })
}

// 获得设备与保养项关联分页
export function getMaintenanceDeviceEntryPage(query) {
  return request({
    url: '/device/maintenance-device-entry/page',
    method: 'get',
    params: query
  })
}

// 导出设备与保养项关联 Excel
export function exportMaintenanceDeviceEntryExcel(query) {
  return request({
    url: '/device/maintenance-device-entry/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
